package com.hengpeng.itfinbase.persist;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;

import com.hengpeng.common.persist.entity.AbstractTableAutoIdEntity;
import com.hengpeng.common.web.annotation.HtmlInput;
import com.hengpeng.common.web.annotation.HtmlInputPattern;
import com.hengpeng.common.web.annotation.HtmlInputType;

/**
 * <pre>
 * 资讯文章信息
 * </pre>
 * @author linriqing
 * @version 1.0, 2010-7-19
 */
@Entity
public class Article extends AbstractTableAutoIdEntity
{
	private static final long serialVersionUID = -6648230166061860210L;

	/**
	 * 操作员编号
	 */
	@HtmlInput(label = "操作员", type = HtmlInputType.TEXT, index = 2, nullable = false)
	@Column(length = 30)
	private String appUserId;

	@HtmlInput(label = "作者", type = HtmlInputType.TEXT, index = 2, nullable = false)
	@Column(length = 30)
	private String author;

	@HtmlInput(label = "类别", type = HtmlInputType.SELECT, index = 3, nullable = false, labelProperty = "name", valueProperty = "id", items = "categorys")
	@ManyToOne(fetch = FetchType.EAGER, targetEntity = ArticleCategory.class)
	private ArticleCategory category;

	/**
	 * 点击数
	 */
	@HtmlInput(label = "点击率", type = HtmlInputType.TEXT, index = 11)
	private Long clickRate;

	@Lob
	private String content;

	@HtmlInput(label = "完整标题", type = HtmlInputType.TEXT, index = 1, nullable = false)
	@Column(length = 255)
	private String fullTitle;

	@HtmlInput(label = "是否审核通过", type = HtmlInputType.SELECT, index = 6, nullable = false, labelProperty = "text")
	@Column(length = 10)
	@Enumerated(javax.persistence.EnumType.STRING)
	private BoolValue isAudited;

	@HtmlInput(label = "是否高亮显示", type = HtmlInputType.SELECT, index = 6, nullable = false, labelProperty = "text")
	@Column(length = 10)
	@Enumerated(javax.persistence.EnumType.STRING)
	private BoolValue isHignlight;

	@HtmlInput(label = "是否置顶", type = HtmlInputType.SELECT, index = 8, nullable = false, labelProperty = "text")
	@Column(length = 10)
	@Enumerated(javax.persistence.EnumType.STRING)
	private BoolValue isTop;

	@HtmlInput(label = "关键字", type = HtmlInputType.TEXT, index = 1, nullable = false)
	@Column(length = 255)
	private String keywords;

	@HtmlInput(label = "发布时间", type = HtmlInputType.TEXT, pattern = HtmlInputPattern.DATETIME, index = 10, format = "yyyy-MM-dd HH:mm", nullable = false)
	private Date publishTime;

	@HtmlInput(label = "真实姓名", type = HtmlInputType.TEXT, index = 2, nullable = false)
	@Column(length = 30)
	private String realName;

	@HtmlInput(label = "置顶结束时间", type = HtmlInputType.TEXT, pattern = HtmlInputPattern.DATETIME, index = 9, format = "yyyy-MM-dd HH:mm", nullable = true)
	private Date setTopEndTime;

	@HtmlInput(label = "来源", type = HtmlInputType.TEXT, index = 5, nullable = true)
	@Column(length = 100)
	private String source;

	/**
	 * 静态文件地址
	 */
	@Column(length = 255)
	private String staticFilePath;

	@HtmlInput(label = "列表标题", type = HtmlInputType.TEXT, index = 4, nullable = false)
	@Column(length = 255)
	private String title;

	@HtmlInput(label = "头条新闻颜色", type = HtmlInputType.TEXT, index = 2, nullable = false)
	@Column(length = 10)
	private String titleColor;

	@HtmlInput(label = "最后更新时间", type = HtmlInputType.TEXT, pattern = HtmlInputPattern.DATETIME, index = 10, format = "yyyy-MM-dd HH:mm", nullable = false)
	private Date updateTime;

	public String getAppUserId()
	{
		return appUserId;
	}

	public String getAuthor()
	{
		return author;
	}

	public ArticleCategory getCategory()
	{
		return category;
	}

	public Long getClickRate()
	{
		return clickRate;
	}

	public String getContent()
	{
		return content;
	}

	public String getFullTitle()
	{
		return fullTitle;
	}

	public BoolValue getIsAudited()
	{
		return isAudited;
	}

	public BoolValue getIsHignlight()
	{
		return isHignlight;
	}

	public BoolValue getIsTop()
	{
		return isTop;
	}

	public String getKeywords()
	{
		return keywords;
	}

	public Date getPublishTime()
	{
		return publishTime;
	}

	public String getRealName()
	{
		return realName;
	}

	public Date getSetTopEndTime()
	{
		return setTopEndTime;
	}

	public String getSource()
	{
		return source;
	}

	public String getStaticFilePath()
	{
		return staticFilePath;
	}

	public String getTitle()
	{
		return title;
	}

	public String getTitleColor()
	{
		return titleColor;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setAppUserId(String appUserId)
	{
		this.appUserId = appUserId;
	}

	public void setAuthor(String author)
	{
		this.author = author;
	}

	public void setCategory(ArticleCategory category)
	{
		this.category = category;
	}

	public void setClickRate(Long clickRate)
	{
		this.clickRate = clickRate;
	}

	public void setContent(String content)
	{
		this.content = content;
	}

	public void setFullTitle(String fullTitle)
	{
		this.fullTitle = fullTitle;
	}

	public void setIsAudited(BoolValue isAudited)
	{
		this.isAudited = isAudited;
	}

	public void setIsHignlight(BoolValue isHignlight)
	{
		this.isHignlight = isHignlight;
	}

	public void setIsTop(BoolValue isTop)
	{
		this.isTop = isTop;
	}

	public void setKeywords(String keywords)
	{
		this.keywords = keywords;
	}

	public void setPublishTime(Date publishTime)
	{
		this.publishTime = publishTime;
	}

	public void setRealName(String realName)
	{
		this.realName = realName;
	}

	public void setSetTopEndTime(Date setTopEndTime)
	{
		this.setTopEndTime = setTopEndTime;
	}

	public void setSource(String source)
	{
		this.source = source;
	}

	public void setStaticFilePath(String staticFilePath)
	{
		this.staticFilePath = staticFilePath;
	}

	public void setTitle(String title)
	{
		this.title = title;
	}

	public void setTitleColor(String titleColor)
	{
		this.titleColor = titleColor;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

}